//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first
#define Y                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)

bool rel[110][110];
int main()
{
	int n,m,k;
	cin >> n >> k >> m;
	/*
	n - pupils
	k - classes
	m - days
	*/
	VI r(n);
	FOR(i,0,n) {
		r[i] = i%k;
	}
	vector<PII> Q;
	FOR(i,0,n) {
		FOR(j,0,n) {
			if( r[i]==r[j] )
				rel[j][i] = rel[i][j] = 1;
			else
				Q.PB( MP(i,j) );
		}
	}
	vector<PII> res;
	FOR(i,0,n/2) {
		res.PB( MP(2*i,2*i+1));
		rel[2*i+1][2*i] = rel[2*i][2*i+1] = 1;
	}
	if(n%2) {
		res.PB( MP(SZ(r)-1,SZ(r)-2) );
		rel[SZ(r)-2][SZ(r)-1] = rel[SZ(r)-1][SZ(r)-2] = 1;
	}
	int it = 0;
	while(SZ(res)<m) {
		if( !rel[Q[it].X][Q[it].Y] ) {
			res.PB( Q[it] );
			rel[Q[it].X][Q[it].Y] = rel[Q[it].Y][Q[it].X] = 1;
		}
		it++;
	}
	FOR(i,0,n)
		cout << r[i]+1 << endl;
	FOR(i,0,SZ(res))
		cout << res[i].X+1 << " " << res[i].Y+1 << endl;
    return 0;
}